﻿/*
* @Author: z.p
* @Project: Zdotp
* @Date: 2025年01月01日
* @Description: 定时器demo服务端展示
*/

using TimerServer.Actors;
using Zdotp.Actor;
using Zdotp.Actor.Kcp;
using Zdotp.Logs;
using Zdotp.ObjectPool;

namespace TimerServer;

internal class Program
{
    public static void Main(string[] args)
    {
        // 设置日志参数
        ZLogger.SetConfig(LogHelper.CreateConsoleLogConfig, LogHelper.Level.Info, LogHelper.Level.Fatal);
        // ZyLogger.SetConfig(LogHelper.CreateFileLogConfig, LogHelper.Level.Warn, LogHelper.Level.Fatal);

        ObjectPoolManager.IsLogger = true;
        
        var actorSystem = new ActorSystem("timer-system");
        actorSystem.AddActor(() => new TimerTestActor(), 1);
        actorSystem.AddActor(() => new ActorKcp("127.0.0.1", 7890), 2);
        actorSystem.Start([typeof(Program).Assembly]);
    }
}